Conversation
Document the plan to unify disk state, React state, and XState machine into a single Zustand store with automatic Electron IPC sync.
Implements the foundation for unifying disk state, React state, and XState into a single reactive store as described in docs/roadmap/reactive-state-management.md. Key additions: - Zustand store with typed slices for config, auth, runner, jobs, github, update, and UI state - YAML persistence middleware with debounced atomic writes - XState synchronization middleware to sync runner machine state to store - Zubridge integration for automatic main→renderer state sync - Renderer hooks (useStore, useDispatch, convenience hooks for each slice) The store infrastructure runs alongside the existing Context providers. Next step is to migrate each Context to use the Zustand store as its backing state, eventually removing the Contexts entirely. Dependencies added: - zustand: Core state management - @zubridge/electron: Electron IPC state synchronization
- Add zubridge mock for renderer tests - Update AppConfigContext to read from Zustand store when synced - Use fallback state (from IPC) until zubridge is ready - Add settings IPC handler updates to sync with Zustand store - Configure webpack fallbacks for Node.js modules in renderer - Add userFilter mode validation when loading settings
Both contexts now follow the same pattern as AppConfigContext: - Read state from Zustand store when zubridge has synced - Use fallback state (from IPC) until zubridge is ready - Actions continue to call IPC, which updates the main store - zubridge automatically syncs changes back to renderer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unify disk state, React state, and XState machine into a single Zustand store with automatic Electron IPC sync.